package com.lzx.mq.Listener.article;

import com.lzx.mq.feign.ESClient;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author 程序员星星
 * @date 2023/2/10
 * @Description
 */
@Component
@RocketMQMessageListener(consumerGroup = "article-edit-group", topic = "article-edit-topic")
public class EditArticleListener implements RocketMQListener<String> {
    @Resource
    private ESClient esClient;

    @Override
    public void onMessage(String message) {
        System.out.println(message);
        //es数据同步
        esClient.editArticle(Long.valueOf(message));
    }
}
